var maxPower = function (s) {
    let result = 0
    let sum = 0
    let temp = s[0]
    for (let i = 0; i < s.length; i++) {
        if (temp === s[i]) {
            sum++
        } else {
            temp = s[i]
            result = result > sum ? result : sum
            sum = 0
        }
    }
    result = result > sum ? result : sum
    return result
}

console.log('结果是' + maxPower('cc'));
